Article 872 of rec.games.corewar: From: ajpierce@med.unc.edu (Andrew Pierce) Newsgroups: rec.games.corewar Subject: Crimp Message-ID: <1992May9.222015.21779@samba.oit.unc.edu> Date: 9 May 92 22:20:15 GMT Sender: usenet@samba.oit.unc.edu Organization: UNC-CH School of Medicine Lines: 63 Nntp-Posting-Host: salvo.med.unc.edu No more originality huh? Ummm. Here is my program Crimp. Crimp is a combined off axis cmp scanner/mutagen. Notice the cmp engine in the first 4 instructions. The bottom line is that in three cycles, Crimp has compared two different addresses and mutagenized a third for an overall memory access efficiency of 1.0 I know of no other program that is so fast, save Imp. Cmp scanners typically scan two locations in 3 cycles for an efficiency of 0.666, B-field scanners scan 1 location in 2 cycles for an efficiency of 0.5 while dwarfs typically bomb one location in three cycles for an efficiency of 0.333. Of course, the mutagenizing djn is not very destructive however it confers two advantages when fighting other scanners: 1) other scanners will pick up the djn'd instruction and spend time bombing it. 2) scanners typically have very tight main executing loops of 2 to 4 instructions. Triggering another scanner into executing a bombing routine means that a small bomb (such as an spl-jmp) will be executed faster which obviates the need for dropping a large carpet of bombs. The second thing to notice is the choice of scan constant of 566. The way this program is set up, this constant yields a "fibbonacci scan". The distance between scanned locations is first 283, then 207, 76, 55, 21, 13, 8, 5, 3, 2 and finally 1. Since a binary search is not practical, a fibbonacci scan is the next best thing with the maximum evenness of spread. This is the most efficient type of general scanning pattern of which I am aware. Of course, it is possible to come up with more efficient patterns against _a specific size of target_, but I think that in general, this scan is the better choice. Crimp was the "new idea" to which I alluded a few days ago. I credit Stefan Strack and his program Agony for getting me interested in cmp scanners again. Note that the idea of "making the loop useful" is also applicable to dwarfs... I tried something of the sort (not very seriously) with my program "Superdwarf" which appeared briefly on the hill a while ago. -Andy ajpierce@med.unc.edu P.S. It might be fun to have an experimental hill where all 20 programs are put into the arena at the same time to fight it out. ;redcode ;name Crimp ;author Andy Pierce ;strategy small cmp scanner ;strategy bigger than ClaMP, more destructive than ClaMP ;strategy full release version, optimize constants ;kill Crimp ret add offset,start start cmp -834,-551 ;15 - 2n jmp hit,0 count djn ret,